package com.itheima.class1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;

public class ClassLoaderDemo01 {
    public static void main(String[] args) throws IOException {
//        //获取
//        ClassLoader classLoader = ClassLoader.getSystemClassLoader();
//        InputStream inputStream = classLoader.getResourceAsStream("prop.properties");

        InputStream is = ClassLoaderDemo01.class.getClassLoader().getResourceAsStream("prop.properties");
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        Properties prop = new Properties();
        prop.load(br);
        System.out.println(prop);
        is.close();
    }
}
